    def new_func():
    stud_ents = []

    while True:
        name = input("请输入姓名：")
        yu-wen = int(input("请输入语文成绩："))
        shu-xu = int(input("请输入数学成绩："))
        zong_cheng_ji = yu-wen + shu-xue
        stud_ents.append({
        "姓名": name,
        "语文成绩": yu-wen,
        "数学成绩": shu-xue,
        "总成绩": zong_cheng_ji,
    })
        print(f"{len(stud_ents)}")
        print(stud_ents)
        if len(stud_ents) >= 3:
            s = input("YES结束列表")
            if s.lower() == "yes":
                break
            yu_wen_pai = []
            shu_xue_pai=[]
            zong_cheng_ji_pai=[]
            for v in stud_ents:
                 yu_wen_pai.append(v.copy())
                 shu_xue_pai.append(v.copy())
                 zong_cheng_ji_pai.append(v.copy())



            for i in range(len(yu_wen_pai)-1):
                for s in range(i+1, len(yu_wen_pai)):
                    if yu_wen_pai[i]["语文成绩"] < yu_wen_pai[s]["语文成绩"]:
                        b = yu_wen_pai[s]
                        yu_wen_pai[s] = yu_wen_pai[i]
                        yu_wen_pai[i] =b

            for i in range(len(shu_xue_pai)-1):
                for i in range(i+1, len(shu_xue_pai)):
                    if shu_xue_pai[i]["数学成绩"] < shu_xue_pai[s]["数学成绩"]:
                        b = shu_xue_pai[s]
                        shu_xue_pai[s] = shu_xue_pai[i]
                        shu_xue_pai[i] = b

            for i in range(len(zong_cheng_ji_pai)-1):
                for i in range(i+1, len(zong_cheng_ji_pai)):
                    if zong_cheng_ji_pai[i]["总成绩"] < zong_cheng_ji_pai[s]["总成绩"]:
                        b = zong_cheng_ji_pai[s]
                        zong_cheng_ji_pai[s] = zong_cheng_ji_pai[i]
                        shu_xue_pai[1] = b

            for i in range(0,3):
                del yu_wen_pai[i]["语文成绩"]
                del yu_wen_pai[i]["总成绩"]
                print(yu_wen_pai[i])

            for i in range(0,3):
                del shu_xue_pai[i]["数学成绩"]
                del shu_xue_pai[i]["总成绩"]
                print(shu_xue_pai[i])

            for i in range(0,3):
                del zong_cheng_ji_pai[i]["语文成绩"]
                del zong_cheng_ji_pai[i]["数学成绩"]

new_func()